A file system consistency check tool (such as “fsck”) is an important utility for maintaining a file system. In checking file system consistency, the tool compares logical file system metadata with physical file system metadata and reports and/or repairs inconsistencies. Logical and physical metadata may include a logical pathname or address, an offset and/or data length, a physical address, a reference count (e.g., the number of logical paths to the same physical address), a bitmap or other data structure tracking usage of physical storage addresses, a checksum, etc. Potential inconsistencies include, for example, 1) a logical address pointing to or otherwise mapping to a physical address marked as free space, 2) a physical address storing data without a corresponding logical address mapping to the physical address, and 3) a reference count that is greater or less than the number of logical addresses mapped to the corresponding physical address.
To compare logical file system metadata with physical file system metadata, a file system consistency check tool reads and uses logical file system metadata to build, in memory, the expected set of physical file system metadata (e.g., bitmap, reference count, etc.) that would correspond to the logical file system metadata. The tool compares the expected set of physical file system metadata with the actual set of physical file system metadata and reports and/or corrects inconsistencies. A file system distributed across multiple nodes, however, is likely to result in an expected set of physical file system metadata that is too large to fit within the memory of a single node. Additionally, a single node checking the consistency of a distributed file system would be an inefficient use of resources.